<?php

namespace App\Http\Controllers\Stats\User;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Resources\Common\DatasResource;
use App\Services\Stats\User\RetentionService;

class RetentionController extends Controller
{

    /**
     * 数据列表【游戏留存】
     */
    public function game(Request $request)
    {
        list ($collection, $total) = RetentionService::make()->game($request);

        return DatasResource::make($collection)->setPaginateTotal($total);
    }

    /**
     * 数据列表【注册留存】
     */
    public function sign(Request $request)
    {
        list ($collection, $total) = RetentionService::make()->sign($request);

        return DatasResource::make($collection)->setPaginateTotal($total);
    }
}
